From adb41b1b591597ad759108d3ecdffda7ab761758 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Mon, 9 Jul 2018 16:29:42 +0200 Subject: [PATCH] babl: fix bug in icc tag alignment --- babl/babl-icc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/babl/babl-icc.c b/babl/babl-icc.c index ed6e0cc..9d520b9 100644 --- a/babl/babl-icc.c +++ b/babl/babl-icc.c @@ -392,7 +392,10 @@ static const Babl *babl_trc_from_icc (ICC *state, int offset, static void icc_allocate_tag (ICC *state, const char *tag, int size) { - state->no+=((4-state->o)%4);state->o = state->no;state->psize = size; + while (state->no % 4 != 0) + state->no++; + + state->o = state->no;state->psize = size; icc_write (sign, 128 + 4 + 4 * state->headpos++, tag); icc_write (u32, 128 + 4 + 4 * state->headpos++, state->o); icc_write (u32, 128 + 4 + 4 * state->headpos++, size); -- 2.30.2